package com.cq.androidtools.recycleview

import android.R
import android.content.Context
import android.util.Log
import com.cq.androidtools.recycleview.base.BaseViewHolder
import com.cq.base.recycleview.base.BaseRecycleViewDiffAdapter

/**
 * 作者: CQ
 * 日期: 2021-07-14
 * 说明:
 */
class ARecycleAdapter(list: MutableList<String>, context: Context) : BaseRecycleViewDiffAdapter<String>(list, context) {
    override fun getInflate(): Int {
        return R.layout.simple_list_item_1
    }

    override fun bindData(holder: BaseViewHolder, data: String, position: Int) {
        Log.e("bindData", "text = ${list[position]}")
        holder.getTextView(R.id.text1).text = list[position]
    }

    override fun areItemsTheSame(oldItem: String, newItem: String): Boolean {
        return oldItem == newItem
    }
}